package 常用字符流;

import java.io.FileReader;
import java.io.IOException;
//文件字符输入流
//FileReader
public class FileReaderExample {
    public static void main(String[] args) {
        try (FileReader reader = new FileReader("example.txt")) {
            int charCode;
            // 逐个字符读取文件内容
            while ((charCode = reader.read()) != -1) {
                char character = (char) charCode;
                System.out.print(character);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}